package com.jdk.learn.juc2.lock.locksupport;

import java.util.concurrent.locks.LockSupport;

/**
 * 类功能描述:
 *
 * @author bgt
 * @version V1.0
 * @since 2019-02-15 15:58
 */
public class LockSupportDemo3 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            System.out.println("child begin park");
            while (!Thread.currentThread().isInterrupted()) {
                LockSupport.park();
            }
            System.out.println("child end park");
        });
        thread.start();
        Thread.sleep(1000);

        System.out.println("main begin unpark");
        thread.interrupt();
    }

}
